<script type="text/javascript" src="./src/js/swfobject.js"></script>
<script type="text/javascript" src="./src/js/uploadify.min.js"></script>
<script>
$(document).ready(function() {
	$("#pic").uploadify({
		'uploader': './src/swf/uploadify.swf',
		'script': './?controller=upload',
		'scriptData': {'name':'home'},
		'buttonImg' : './src/img/upload.png',
		'height': 30,
		'width': 110,
		'cancelImg': './src/img/cancel.png',
		'auto': true,
		'onComplete': function(a, b, c, d, e){
			var f = d.split(';;');
			if(f[0] == '0'){
				alert('上传出错了,请重新上传');
			}else{
				$('#picurl').attr("value",f[0]);
				$('#picshow').html('');
				$('#picshow').html('<img width="300" src="'+f[0]+'" />');
			}
		}
	});
	$("#pic2").uploadify({
		'uploader': './src/swf/uploadify.swf',
		'script': './?controller=upload',
		'scriptData': {'name':'home'},
		'buttonImg' : './src/img/upload.png',
		'height': 30,
		'width': 110,
		'cancelImg': './src/img/cancel.png',
		'auto': true,
		'onComplete': function(a, b, c, d, e){
			var f = d.split(';;');
			if(f[0] == '0'){
				alert('上传出错了,请重新上传');
			}else{
				$('#picurl2').attr("value",f[0]);
				$('#picshow2').html('');
				$('#picshow2').html('<img width="300" src="'+f[0]+'" />');
			}
		}
	});
	$("#pic3").uploadify({
		'uploader': './src/swf/uploadify.swf',
		'script': './?controller=upload',
		'scriptData': {'name':'home'},
		'buttonImg' : './src/img/upload.png',
		'height': 30,
		'width': 110,
		'cancelImg': './src/img/cancel.png',
		'auto': true,
		'onComplete': function(a, b, c, d, e){
			var f = d.split(';;');
			if(f[0] == '0'){
				alert('上传出错了,请重新上传');
			}else{
				$('#picurl3').attr("value",f[0]);
				$('#picshow3').html('');
				$('#picshow3').html('<img width="300" src="'+f[0]+'" />');
			}
		}
	});
});
</script>
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="guide">
	<tr>
		<td>
			<span style="float: left;">后台管理中心&nbsp;&raquo;&nbsp;产品管理</span>
			<span style="float: right;">
				<a href="javascript:history.go(-1);">&lt;- 返回</a>
			</span>
		</td>
	</tr>
</table>

<form action="./?controller=account&action=doadd" method="post">
<input type="hidden" name="id" value="<?php echo $this->product['id'];?>" />
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
	<tr class="header">
		<td colspan="11">产品信息(标*号的必填)</td>
	</tr>
	<tr>
		<td class="altbg1">名称1 *</td>
		<td class="altbg2">
			<input class="input" name="name1" value="<?php echo $this->product['name'];?>" />
		</td>
	</tr>
	<tr>
		<td class="altbg1">名称2 *</td>
		<td class="altbg2">
			<input class="input" name="name2" value="<?php echo $this->product['name_1'];?>" />
		</td>
	</tr>
	<tr>
		<td class="altbg1">名称3 *</td>
		<td class="altbg2">
			<input class="input" name="name3" value="<?php echo $this->product['name_2'];?>" />
		</td>
	</tr>
	<tr>
		<td class="altbg1">上传图片1 *</td>
		<td class="altbg2">
			<input class="inputWide" name="pic" id="pic" type="file" />
			<input type="hidden" name="img" value="<?php echo $this->product['img']; ?>" id="picurl">
		</td>
	</tr>
	<tr>
		<td class="altbg1">预览图片1</td>
		<td class="altbg2">
			<div id="picshow">
				<?php if (isset($this->product['img'])){ echo '<img width="300" src="'.DOMAIN.$this->product['img'].'" />';}?>
			</div>
		</td>
	</tr>
	<tr>
		<td class="altbg1">上传图片2 *</td>
		<td class="altbg2">
			<input class="inputWide" name="pic2" id="pic2" type="file" />
			<input type="hidden" name="img2" value="<?php echo $this->product['img_1']; ?>" id="picurl2">
		</td>
	</tr>
	<tr>
		<td class="altbg1">预览图片2</td>
		<td class="altbg2">
			<div id="picshow2">
				<?php if (isset($this->product['img_1'])){ echo '<img width="300" src="'.DOMAIN.$this->product['img_1'].'" />';}?>
			</div>
		</td>
	</tr>
	<tr>
		<td class="altbg1">上传图片3 *</td>
		<td class="altbg2">
			<input class="inputWide" name="pic3" id="pic3" type="file" />
			<input type="hidden" name="img3" value="<?php echo $this->product['img_2']; ?>" id="picurl3">
		</td>
	</tr>
	<tr>
		<td class="altbg1">预览图片3</td>
		<td class="altbg2">
			<div id="picshow3">
				<?php if (isset($this->product['img_2'])){ echo '<img width="300" src="'.DOMAIN.$this->product['img_2'].'" />';}?>
			</div>
		</td>
	</tr>
	<tr>
		<td class="altbg1">寻租人数 *</td>
		<td class="altbg2">
			<input class="input" name="needs" value="<?php echo $this->product['needs'];?>" />
		</td>
	</tr>
	<tr>
		<td class="altbg1">排序 *</td>
		<td class="altbg2">
			<input class="input" name="rank" value="<?php echo $this->product['rank'];?>" />
		</td>
	</tr>
	<tr>
		<td class="altbg1" colspan=2 align="center">
			<input class="button" type="submit" value="确定" />
			&nbsp;
			<input class="button" type="reset" value="重置" />
		</td>
	</tr>
</table>
</form>
